﻿using System;
using System.Collections.Generic;
using System.Text;

using Xunit;

namespace Unity.Type.Tests
{
    public class EventTypeTest
    {
        private EventType? FoundEventTypeEnumByValue(byte value)
        {
            switch (value)
            {
                case 1:
                    return EventType.Create;
                case 2:
                    return EventType.Update;
                case 3:
                    return EventType.DeleteId;
                case 4:
                    return EventType.DeleteVersion;
                default:
                    return null;
            }
        }
        [Fact]
        public void EnumValuesTest()
        {
            Assert.Equal(EventType.Create, FoundEventTypeEnumByValue(1));
            Assert.Equal(EventType.Update, FoundEventTypeEnumByValue(2));
            Assert.Equal(EventType.DeleteId, FoundEventTypeEnumByValue(3));
            Assert.Equal(EventType.DeleteVersion, FoundEventTypeEnumByValue(4));
            Assert.Null(FoundEventTypeEnumByValue(Byte.MinValue));
            Assert.Null(FoundEventTypeEnumByValue(Byte.MaxValue));
        }
    }
}


